package com.example.novelsys.service;
//会员用户的持久CRUD


import com.example.novelsys.dao.UserDao;
import com.example.novelsys.entity.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.security.MessageDigest;
import java.util.List;

@Service
public class UserService {
    @Autowired
    UserDao userDao;
	

    //注册用户
    public int addUser(Users user) {

        return userDao.addUser(user);
    }

    //用户登录
    public List<Users> queryByName(String username){
        return userDao.queryByName(username);
    }

    //根据用户id查询用户信息
    public Users queryByKey(Long userId){
        return userDao.queryByKey(userId);
    }
}
